package com.fengshang.wedding.web.module.api;

import java.util.Collection;
/**
 * 
 *@author gembin@gmail.com
 * 
 */
public class Module {
	//module type
	public static final int TYPE_TEXT = 0;
	public static final int TYPE_MENU = 1;
	public static final int TYPE_TEMPLATE = 2;
	//module mode
	public static final int MODE_SILENT = 0;
	public static final int MODE_NORMAL = 1;
	/**
	 * module name
	 */
	private String name;
	/**
	 * module type
	 */
	private int type;
	/**
	 * javascript
	 */
	private Collection<String> js; 
	/**
	 * javascript
	 */
	private Collection<String> css; 
	/**
	 * module mode
	 */
	private int mode = MODE_NORMAL;

	public int getMode() {
		return mode;
	}

	public void setMode(int mode) {
		this.mode = mode;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	
	public Collection<String> getJs() {
		return js;
	}

	public void setJs(Collection<String> js) {
		this.js = js;
	}

	public Collection<String> getCss() {
		return css;
	}

	public void setCss(Collection<String> css) {
		this.css = css;
	}
	/**
	 * @param <T>
	 * @param c
	 * @param m
	 * @return
	 */
	public static <T>T castTo(Class<T>c,Module m){
		if(m==null)return null;
		return c.cast(m);
	}

}
